﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ToolRental.Model
{
    [Table("ToolTypes")]
    public class ToolType
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required]
        [Display(Name = "Gyártó")]
        public string BrandName { get; set; }

        [Required]
        [Display(Name = "Típus")]
        public string TypeName { get; set; }

        #region NotMapped
        [NotMapped]
        public string Name
        {
            get
            {
                return BrandName + " " + TypeName;
            }
        }

        [NotMapped]
        public string Availability { get; set; }

        [NotMapped]
        public bool Ordered { get; set; }

        [NotMapped]
        public bool Borrowed { get; set; }

        [NotMapped]
        public bool OrderVisibility
        {
            get
            {
                return ((!Ordered) && (!Borrowed));
            }
        }

        [NotMapped]
        public bool IsChecked { get; set; }

        [NotMapped]
        public DateTime StartDate { get; set; }

        [NotMapped]
        public string UserName { get; set; }

        #endregion


    }
}
